package cn.dengta.webapp.trade.model;

import cn.dengta.common.model.ValueProxy;
import cn.dengta.context.model.AdminEnumI18nKey;
import cn.dengta.context.model.LabelI18nProxy;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

@Getter
public enum AgentLevel implements LabelI18nProxy<AgentLevel, Integer> {
	/** 一级推广员 */
	ONE(1, AdminEnumI18nKey.AGENT_LEVEL_ONE, "①"),
	/** 二级推广员 */
	TWO(2, AdminEnumI18nKey.AGENT_LEVEL_TWO, "②");

	@EnumValue
	public Integer value;
	public String sign;
	final ValueProxy<AgentLevel, Integer> proxy;

	// 构造函数，枚举类型只能为私有
	AgentLevel(Integer value, String label, String sign) {
		this.value = value;
		this.sign = sign;
		this.proxy = new ValueProxy<>(this, value, label);
	}

	public static final AgentLevel[] CACHE = values();

	public static AgentLevel of(Integer value) {
		return ONE.getValueOf(value);
	}

}
